/**
 The Minerva Project, DAG Scheduling Tools
 Copyright (C) 2006 Florin Pop & Stefan Bucur

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 */

package ro.pub.cs.minerva.task;

import java.io.Serializable;

/**
 * @author Florin Pop Class which contains the requirements of a task
 */
public class TaskRequirements implements Serializable, Cloneable {

	private static final long serialVersionUID = 200701031513L;

	/*
	 * the variables which describe the specific requirements of this task in
	 * order to be executed
	 */
	private double memory;
	private double cpuPower;
	private long processingTime;
	private long deadlineTime;
	private int schedulePriority;

	/**
	 * Implicit contructor. You must use explicit constructor or setter funtions
	 * if you want to set some requirements for a task
	 * 
	 */
	public TaskRequirements() {
		this.memory = 0D;
		this.cpuPower = 0D;
		this.processingTime = 0L;
		this.deadlineTime = 0L;
		this.schedulePriority = 1;
	}

	/**
	 * Ecplicit constructor for a simple Task
	 * 
	 * @param memory
	 * @param cpuPower
	 * @param formatedProcessingTime
	 * @param formatedDeadlineTime
	 * @param schedulePriority
	 */
	public TaskRequirements(double memory, double cpuPower,
			long processingTime, long deadlineTime, int schedulePriority) {

		this.memory = memory;
		this.cpuPower = cpuPower;
		this.processingTime = processingTime;
		this.deadlineTime = deadlineTime;
		this.schedulePriority = schedulePriority;
	}

	/**
	 * @return the cpuPower
	 */
	public double getCpuPower() {
		return cpuPower;
	}

	/**
	 * @param cpuPower
	 *            the cpuPower to set
	 */
	public void setCpuPower(double cpuPower) {
		this.cpuPower = cpuPower;
	}

	/**
	 * @return the deadlineTime
	 */
	public long getDeadlineTime() {
		return deadlineTime;
	}

	/**
	 * @param deadlineTime
	 *            the deadlineTime to set
	 */
	public void setDeadlineTime(long deadlineTime) {
		this.deadlineTime = deadlineTime;
	}

	/**
	 * @return the memory
	 */
	public double getMemory() {
		return memory;
	}

	/**
	 * @param memory
	 *            the memory to set
	 */
	public void setMemory(double memory) {
		this.memory = memory;
	}

	/**
	 * @return the processingTime
	 */
	public long getProcessingTime() {
		return processingTime;
	}

	/**
	 * @param processingTime
	 *            the processingTime to set
	 */
	public void setProcessingTime(long processingTime) {
		this.processingTime = processingTime;
	}

	/**
	 * @return the schedulePriority
	 */
	public int getSchedulePriority() {
		return schedulePriority;
	}

	/**
	 * @param schedulePriority
	 *            the schedulePriority to set
	 */
	public void setSchedulePriority(int schedulePriority) {
		this.schedulePriority = schedulePriority;
	}

	@Override
	public String toString() {
		return new String("[memory=" + memory + ",cpuPower=" + cpuPower
				+ ",processingTime=" + processingTime + ",deadlineTime="
				+ deadlineTime + ",schedulePriority=" + schedulePriority + "]");
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		
		return super.clone();
	}
	
	
}
